const mongoose = require('mongoose')
const Message = require('../../model/message')

module.exports = async (req, res) => {
    const id = req.params.id
    try {
        var data = await Message.findOneAndDelete({ _id: id })
    } catch (error) {
        return res.send({
            data: null,
            meta: {
                status: 400,
                msg: '删除失败'
            }
        })
    }
    res.send({
        data: null,
        meta: {
            status: 204,
            msg: '删除成功'
        }
    })

}